Skip to content

chore: retire the bundled overLIB library - #337

Merged
TheWitness merged 7 commits into
developfrom
chore/remove-overlib
Nov 11, 2026
Merged

TheWitness merged 7 commits into
developfrom
chore/remove-overlib

Conversation

@somethingwithproof

Copy link
Copy Markdown
Member

Fixes #335

Remove docs/example/overlib.js, which built code strings for eval().

  • Only the static docs example loaded it. The viewer renders HTMLSTYLE overlib hovers from data-hover through js/weathermap.js.
  • The example page now uses plain title captions, and the docs say so.
  • The CLI HTML wrapper (weathermap) no longer writes overDiv or a script tag for the unshipped overlib.js. This is a separate commit, so it can be dropped on its own.
  • Tests:
    • a guard that fails if overlib.js comes back, or if shipped JS or docs use eval(), new Function() or string timers;
    • an E2E render of example.conf through ReadConfig, DrawMap and MakeHTML that checks the hover content without overLIB;
    • a jsdom check of the example page.
  • Limitation: the static example's captions show only the link name, without a graph preview.
  • Verified: the full Pest suite passes (482); check-doc-links passes; all browser tests pass apart from ClickableHoverTest, which already fails on develop.

MakeHTML() emits data-hover/data-caption attributes for the Cacti
viewer, so the overDiv container and overlib.js script tag written by
the command-line HTML wrapper did nothing except request a missing file.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
docs/example/overlib.js was only loaded by the static example page and
built code strings for eval(). The plugin viewer renders HTMLSTYLE
overlib hovers from data-hover with js/weathermap.js and never loaded
it. The example page now uses plain title captions.

Add a guard against overlib.js, eval() and code-string timers in the
shipped JavaScript and documentation, an engine render of example.conf
that checks hover content without overLIB, and a jsdom check of the
static example page.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Newer libpng, as used by the PHP 8.6 CI leg, warns about the sRGB profile
embedded in docs/example/my_router.png. Ignore only that message while the
example is read and drawn; any other warning still fails the test.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
The test loads the repository's own js/weathermap.js into its jsdom
context through vm.runInContext, as jsdom documents.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
…e render"

This reverts commit 3b19a5c.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
libpng 1.6 prints "iCCP: known incorrect sRGB profile" whenever the
example map loads my_router.png, which fails the docs example render on
the PHP 8.6 CI leg. Remove the iCCP chunk; the decoded pixels are
unchanged.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Keep tests/Browser/README.md as on develop so this PR does not conflict
with the README rewrite in #333.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

@alcatron

alcatron commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Tested 3aae1ca: all 483 PHP tests passed, including the example-rendering checks. The new example browser test passed too; the only browser failure was the existing ClickableHoverTest issue addressed by #333.

The distinction in the docs is useful here: this removes the old overLIB library and changes the standalone example to simple captions, but keeps OVERLIBGRAPH and the current Cacti viewer's hover handling. The combined automated viewer tests passed once #333 was included.

@alcatron alcatron left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The combined batch, including the updated editor tests, passes 648 PHP tests and all 33 browser test files. No further issue found in my review of the overLIB removal; the current viewer hover tests pass. Looks good to me.

@TheWitness
TheWitness merged commit 408ae77 into develop Nov 11, 2026
9 checks passed
@TheWitness
TheWitness deleted the chore/remove-overlib branch November 11, 2026 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retire the bundled overLIB library from the docs example

4 participants